package com.ruoyi.lm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lm.mapper.LmUserattentionMapper;
import com.ruoyi.lm.domain.LmUserattention;
import com.ruoyi.lm.service.ILmUserattentionService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户关注Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-02
 */
@Service
public class LmUserattentionServiceImpl implements ILmUserattentionService 
{
    @Autowired
    private LmUserattentionMapper lmUserattentionMapper;

    /**
     * 查询用户关注
     * 
     * @param id 用户关注ID
     * @return 用户关注
     */
    @Override
    public LmUserattention selectLmUserattentionById(String id)
    {
        return lmUserattentionMapper.selectLmUserattentionById(id);
    }

    /**
     * 查询用户关注列表
     * 
     * @param lmUserattention 用户关注
     * @return 用户关注
     */
    @Override
    public List<LmUserattention> selectLmUserattentionList(LmUserattention lmUserattention)
    {
        return lmUserattentionMapper.selectLmUserattentionList(lmUserattention);
    }

    /**
     * 新增用户关注
     * 
     * @param lmUserattention 用户关注
     * @return 结果
     */
    @Override
    public int insertLmUserattention(LmUserattention lmUserattention)
    {
        lmUserattention.setCreateTime(DateUtils.getNowDate());
        return lmUserattentionMapper.insertLmUserattention(lmUserattention);
    }

    /**
     * 修改用户关注
     * 
     * @param lmUserattention 用户关注
     * @return 结果
     */
    @Override
    public int updateLmUserattention(LmUserattention lmUserattention)
    {
        return lmUserattentionMapper.updateLmUserattention(lmUserattention);
    }

    /**
     * 删除用户关注对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLmUserattentionByIds(String ids)
    {
        return lmUserattentionMapper.deleteLmUserattentionByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户关注信息
     * 
     * @param id 用户关注ID
     * @return 结果
     */
    @Override
    public int deleteLmUserattentionById(String id)
    {
        return lmUserattentionMapper.deleteLmUserattentionById(id);
    }
}
